#ifndef __S_LOG_H__
#define __S_LOG_H__

#ifdef __cplusplus
extern "C" {
#endif

typedef enum _slog_level {
    S_OFF   = 0,
    S_ERROR = 1,
    S_WARN = 2,
    S_INFO = 3,
    S_DEBUG = 4,
    S_TRACE = 5,
    S_ALL   = 6
} slog_level;

int logger_init(const char *prefix, slog_level level,unsigned int maxSize);
void logger_stop(void);
int logger_reStart(void);
void logger_filename(char * filename,int size);
void write_log(slog_level level, int print_stacktrace, const char *func_name, int line, const char *fmt, ...);
/*
#define SLOG_ST_ERROR(fmt, ...) write_log(S_ERROR, TRUE, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
#define SLOG_ST_WARN(fmt, ...) write_log(S_WARN, TRUE, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
#define SLOG_ST_INFO(fmt, ...) write_log(S_INFO, TRUE, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
#define SLOG_ST_DEBUG(fmt, ...) write_log(S_DEBUG, TRUE, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
#define SLOG_ST_TRACE(fmt, ...) write_log(S_TRACE, TRUE, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)

#define SLOG_ERROR(fmt, ...) write_log(S_ERROR, FALSE, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
#define SLOG_WARN(fmt, ...) write_log(S_WARN, FALSE, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
#define SLOG_INFO(fmt, ...) write_log(S_INFO, FALSE, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
#define SLOG_DEBUG(fmt, ...) write_log(S_DEBUG, FALSE, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
#define SLOG_TRACE(fmt, ...) write_log(S_TRACE, FALSE, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
*/
#ifdef __cplusplus
}
#endif

#endif // !__S_LOG_H__
